package com.moyq5.permit.center.feign.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.moyq5.mvc.framework.general.Body;
import com.moyq5.mvc.framework.general.PageData;
import com.moyq5.mvc.framework.general.Sorting;
import com.moyq5.mvc.framework.jackson.result.ListResult;
import com.moyq5.mvc.framework.jackson.result.ObjectResult;
import com.moyq5.mvc.framework.jackson.result.PageResult;
import com.moyq5.mvc.framework.jackson.result.StatusResult;
import com.moyq5.permit.center.bean.entity.MerchAdmin;
import com.moyq5.permit.center.bean.search.MerchAdmin4Search;
import com.moyq5.permit.center.bean.embed.MerchAdminId;

/**
 * @author Moyq5’s Tools
 * @since 2019-07-25 11:58:13
 */
@FeignClient(name="feign-server", url="${feign.server.url}")
@RequestMapping("/feign/merchAdmin")
public interface MerchAdminFeign {

	@PostMapping("/oneById?filter=")
	@ResponseBody
	ObjectResult<MerchAdmin> one(MerchAdminId id);
	
	@PostMapping("/count")
	@ResponseBody
	ObjectResult<Long> count(Body<MerchAdmin4Search, String> merchAdmin4s);
	
	@PostMapping("/one?filter=")
	@ResponseBody
	ObjectResult<MerchAdmin> one(Body<MerchAdmin4Search, Sorting> merchAdmin4s);
	
	@PostMapping("/list?filter=")
	@ResponseBody
	ListResult<MerchAdmin> list(Body<MerchAdmin4Search, Sorting> merchAdmin4s);

	@PostMapping("/page?filter=")
	@ResponseBody
	PageResult<MerchAdmin> page(Body<MerchAdmin4Search, PageData> merchAdmin4s);

	@PostMapping("/page?filter=admin")
	@ResponseBody
	PageResult<MerchAdmin> pageWithAdmin(Body<MerchAdmin4Search, PageData> merchAdmin4s);

	@PostMapping("/page?filter=merchAndAdmin")
	@ResponseBody
	PageResult<MerchAdmin> pageWithMerchAndAdmin(Body<MerchAdmin4Search, PageData> merchAdmin4s);
	
	@PutMapping
	@ResponseBody
	ObjectResult<MerchAdminId> create(MerchAdmin merchAdmin);
	
	@PatchMapping
	@ResponseBody
	StatusResult update(MerchAdmin merchAdmin);
	
	@DeleteMapping
	@ResponseBody
	StatusResult remove(MerchAdminId id);

}
